package com.webapp.domain.entity;

import java.math.BigDecimal;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
/**
 * 积分流水表
 * @author administrator
 *
 */


@Entity
public class IntegralChange extends BaseEntity {

	private Long id;
	
	private BigDecimal changeScore;//改变的积分，为负值则是减
	
	private Date createDate;//创建时间
	
	private Integral integral;//积分账户
	
	private String describes;//描述
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public BigDecimal getChangeScore() {
		return changeScore;
	}

	public void setChangeScore(BigDecimal changeScore) {
		this.changeScore = changeScore;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY,targetEntity=Integral.class)
	@JoinColumn(name="integral_id")
	public Integral getIntegral() {
		return integral;
	}

	public void setIntegral(Integral integral) {
		this.integral = integral;
	}

	public String getDescribes() {
		return describes;
	}

	public void setDescribes(String describes) {
		this.describes = describes;
	}
	
	
	
}
